home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / c / pcw.zip / FARCOPY.C < prev    next >
Text File  |  1990-01-16  |  1KB  |  25 lines

  1. /***************************************************************/
  2. /* File Id.                     Farcopy.C                      */
  3. /* Author.                      Stan Milam.                    */
  4. /* Date Written.                11/01/89.                      */
  5. /*                                                             */
  6. /*             (c) Copyright 1989-90 by Stan Milam             */
  7. /*                                                             */
  8. /* Routine to copy one far memory address to a far destination */
  9. /* address.  Very usefull in small and medium memory models.   */
  10. /***************************************************************/
  11.  
  12. void farcopy(void far *destination, void far *source, unsigned count) {
  13.  
  14.    char far *srce;
  15.    char far *dest;
  16.    unsigned lcv;
  17.  
  18.    dest = (char far *) destination;         /* Recast void pointer so we */
  19.    srce = (char far *) source;              /* Use pointer arithmitic */
  20.    for (lcv = 0; lcv < count; lcv++) {      /* Copy for count bytes */
  21.        *dest = *srce;                       /* Copy one byte */
  22.        dest++; srce++;                      /* Bump pointers */
  23.    }
  24. }
  25.